<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/4/20
  Time: 10:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/public/header/permissionCommon.jspf" %>
<html>
<head>
    <title>规则数据分析</title>
</head>
<body class="layui-layout-body">

<div class="layui-layout layui-layout-admin">
    <!-- 头部和左侧导航-->
    <div id="header"></div>
    <!--右侧主体区域-->
    <div class="layui-body" >
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">交易与签到信息异常</li>
                <li>派工异常</li>
                <li>老人去世异常</li>
                <li>老人住院异常</li>
            </ul>
            <div class="layui-tab-content">
                <%-----------交易与签到信息异常-----------%>
                <div id="DealAndSignInDiv" class="layui-tab-item layui-show">
                    <table class="layui-table" id="DealAndSignInTable">

                    </table>
                </div>
                <%-----------派工信息异常-----------%>
                <div id="EmployerDiv" class="layui-tab-item">
                    <table class="layui-table" id="ArrangeInfoTable">

                    </table>
                </div>
                <%-----------老人去世信息异常-----------%>
                <div id="ElderDeadDiv" class="layui-tab-item">
                    <table class="layui-table" id="ElderDeadTable">

                    </table>
                </div>
                <%-----------老人住院信息异常-----------%>
                <div id="ElderHospitalDiv" class="layui-tab-item">
                    <table class="layui-table" id="ElderHospitalTable">

                    </table>
                </div>
            </div>
        </div>
    </div>

    <!--底部-->
    <div id="footer"></div>
    <%--<script src="${webPath}/js/permission/auth/permList.js"></script>--%>
    <script>
        $("#header").load("${webPath}/publicPages/permission/fragments/header.jsp");
        $("#footer").load("${webPath}/publicPages/permission/fragments/footer.jsp");
    </script>

    <script>
        layui.use('table',function (){
            var table=layui.table;
            //服务与交易异常记录
            dealAndSignInTable=table.render({
                elem: "#DealAndSignInTable",
                url: "/toDataAnalysis/dealAndSign/",
                id:"dealAndSignIn"
                ,width:800
                ,toolbar:true
                ,defaultToolbar:['exports','print']
                ,title:'服务与交易异常记录'
                ,parseData: function(result){ //result 即为原始返回的数据
                    console.log(result);
                    return {
                        "code": 0, //解析接口状态
                        "msg": "", //解析提示文本
                        "count": result.total, //解析数据长度
                        "data": result.list, //解析数据列表
                    }
                }
                ,cols:[[
                    {field:'lsh' ,title:'交易记录流水号',width: 200,fixed:'left',sort:true},
                    {field:'lr_name' ,title:'老人姓名',width:100},
                    {field:'hg_name' ,title:'护工姓名',width: 100},
                    {field:'jyrq' ,title:'交易日期',templet:function(d){
                            var year=d.jyrq.substring(0,4);
                            var month=d.jyrq.substring(4,6);
                            var day=d.jyrq.substring(6,8);
                            var hour=d.jyrq.substring(8,10);
                            var date=year+'年'+month+'月'+day+'日'+hour+'点';
                            //console.log(date);
                            return date
                        },width: 200,sort:true},
                    {field:'t_sign' ,title:'签退时间',templet:function (d) {
                            return layui.util.toDateString(d.t_sign);
                        },
                        fixed:'right',sort:true},

                ]]

            })

            //派工异常记录
            arrangeInfoTable=table.render({
                elem: "#ArrangeInfoTable",
                url: "/toDataAnalysis/arrangeInfo/",
                id:"arrangeInfo"
                ,toolbar:true
                ,defaultToolbar:['exports','print']
                ,title:'派工常记录'
                ,parseData: function(result){ //result 即为原始返回的数据
                    console.log(result);
                    return {
                        "code": 0, //解析接口状态
                        "msg": "", //解析提示文本
                        "count": result.total, //解析数据长度
                        "data": result.list, //解析数据列表
                    }
                }
                ,cols:[[
                    {field:'sqh' ,title:'评估申请号',width: 200,fixed:'left',sort:true},
                    {field:'nursing_name' ,title:'护工姓名',width: 100},
                    {field:'elder_name' ,title:'老人姓名',width:100},
                    {field:'jhksrq' ,title:'评估计划开始日期', width: 157,sort:true},
                    {field:'first_plan_date' ,title:'派工计划首次制定日期',width:192,sort:true},
                    {field:'sjksrq' ,title:'实际开始日期',width: 135,sort:true},
                    {field:'first_serve_date' ,title:'派工实际日期',width: 134,sort:true},
                    {field:'xq' ,title:'计划工作日',width: 166,sort:true},
                    {field:'chosen_weekday' ,title:'实际工作日',width: 186,sort:true},
                    {field:'apply_time' ,title:'计划时段',width: 160,sort:true},
                    {field:'arrange_time' ,title:'派工时段',fixed:'right',sort:true},

                ]]
            })

            //老人去世异常记录
            elderDeadTable=table.render({
                elem: "#ElderDeadTable",
                url: "/toDataAnalysis/elderDead/",
                id:"elderDead",
                width:645
                ,toolbar:true
                ,defaultToolbar:['exports','print']
                ,title:'老人去世异常记录'
                ,parseData: function(result){ //result 即为原始返回的数据
                    console.log(result);
                    return {
                        "code": 0, //解析接口状态
                        "msg": "", //解析提示文本
                        "count": result.total, //解析数据长度
                        "data": result.list, //解析数据列表
                    }
                }
                ,cols:[[
                    {field:'dead_lsh' ,title:'去世流水号',width: 167,fixed:'left',sort:true},
                    {field:'name' ,title:'老人姓名',width: 122},
                    {field:'dead_time' ,title:'去世时间',width:153},
                    {field:'jyrq' ,title:'结算交易日期',templet:function(d){
                            var year=d.jyrq.substring(0,4);
                            var month=d.jyrq.substring(4,6);
                            var day=d.jyrq.substring(6,8);
                            var hour=d.jyrq.substring(8,10);
                            var date=year+'年'+month+'月'+day+'日'+hour+'点';
                            //console.log(date);
                            return date
                        }, width: 198,sort:true}

                ]]
            })

            //老人住院异常记录
            elderDeadTable=table.render({
                elem: "#ElderHospitalTable",
                url: "/toDataAnalysis/ElderHosp/",
                id:"elderHosp",
                width:800
                ,toolbar:true
                ,defaultToolbar:['exports','print']
                ,title:'老人住院记录'
                ,parseData: function(result){ //result 即为原始返回的数据
                    console.log(result);
                    return {
                        "code": 0, //解析接口状态
                        "msg": "", //解析提示文本
                        "count": result.total, //解析数据长度
                        "data": result.list, //解析数据列表
                    }
                }
                ,cols:[[
                    {field:'hospital_lsh' ,title:'住院流水号',width: 167,fixed:'left',sort:true},
                    {field:'name' ,title:'老人姓名',width: 122},
                    {field:'start_time' ,title:'住院时间',width:153},
                    {field:'end_time' ,title:'出院时间',width:153},
                    {field:'jyrq' ,title:'结算交易日期',templet:function(d){
                            var year=d.jyrq.substring(0,4);
                            var month=d.jyrq.substring(4,6);
                            var day=d.jyrq.substring(6,8);
                            var hour=d.jyrq.substring(8,10);
                            var date=year+'年'+month+'月'+day+'日'+hour+'点';
                            //console.log(date);
                            return date
                        }, width: 198,sort:true}

                ]]
            })
        })
    </script>

</div>

</body>
</html>
